<?php

namespace Common\Service;


/** 
 * 
 * @author Legend. <xcx_legender@qq.com>
 * @param 
 * @return 
 */
Class StatisAllService extends BaseService
{

	// 获取视频的统计信息
	public function getVideoStatis($video_id)
	{
		$map = [
			'object_type' => 'video',
			'object_id'   => (int)$video_id
		];
		$data = $this->where($map)->find();
		if ($data) return $data['stat'];
		return [];
	}

	// 设置视频的统计信息
	public function setVideoStatis($video_id, $stat = [])
	{
		$map = [
			'object_type' => 'video',
			'object_id'   => (int)$video_id
		];
		$save['stat'] = $stat;
		$data = $this->where($map)->save($save);
	}

}